#include "maindialog.h"

#include <QApplication>
#include <QInputDialog>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MainDialog w;
    bool ok;
    QString userName = QInputDialog::getText(&w, "提示", "输入登录用户名", QLineEdit::Normal, "", &ok);

    if (ok && !userName.isEmpty()){
        w.login(userName);
    }else{
        a.exit();
        return 0;
    }

    return a.exec();
}
